package com.zst.demo4.converter;

import com.zsr.entities.PermissionDTO;
import com.zsr.entities.RoleDTO;
import com.zst.demo4.po.PermissionPO;

import java.util.Objects;

public class PermissionConverter {
    /**
     * PermissionPO -> PermissionDTO
     *
     * @param po
     * @return
     */
    public static PermissionDTO convert2PermissionDTO(PermissionPO po) {
        PermissionDTO res = new PermissionDTO();
        if (Objects.nonNull(po)) {
            res.setId(po.getId());
            res.setPermissionName(po.getPermissionName());
            res.setPermissionIntro(po.getPermissionIntro());
            res.setGmtCreated(po.getGmtCreated());
            res.setGmtModified(po.getGmtModified());
        }
        return res;
    }
}
